import { getAreaObj } from '@/utils/util'
export const baseConfig: any = {
	pageName: '归档管理',
	dictcodes: ['ORG_OPERATE_STATUS'],
	rowKey: 'id',
	tipName: 'name',
	exportMqTopic: '/ning/export/',
	api: {
		index: 'view_ofsSubsidyFiling_aggregate',
	},
	auth: {
		index: 'view_ofsSubsidyFiling_aggregate',
	},
	menuBtn: [
		
	],
	dialogConfig: {
		width: '90%',
	},
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{
				label: '所属区域',
				propName: 'areas_name',
				type: 'AplidAreaSelect',
				span: 6,
			},
			{
				label: '统一信用代码',
				prop: 'creditCode',
				span: 6,
			},
			{
				label: '养老机构名称',
				prop: 'orgName',
				span: 6,
			},
			{
				label: '机构负责人',
				prop: 'burdenUserName',
				span: 6,
			},
			{
				label: '机构法人',
				prop: 'legalUserName',
				span: 6,
			},
			{
				label: '运营状态',
				prop: 'operateStatus',
				propName: 'operateStatusLabel',
				type: 'remoteSelect',
				api: 'getDictItemList',
				code: 'ORG_OPERATE_STATUS',
				filterKey: 'value',
				multiple: false,
				span: 6,
			},
		],
	},
	tableConfig: {},
	beforeOnLoadFormate: (query) => {
		return new Promise((resolve, reject) => {
			const araesName: any = getAreaObj(query.areas_name, '')
			resolve({
				...query,
				...araesName,
				areas_name: undefined,
			})
		})
	},
	onLoadFormate: async (arr) => {
		const tableData = arr.map((item: any) => {
			if (item.organizationJson) {
				item.organizationInfo = JSON.parse(item.organizationJson)
			}
			return {
				...item,
			}
		})
		return Promise.resolve(Object.freeze(tableData))
	},
}
